const path = require('path')

module.exports = {
  chainWebpack: config => {
    config.resolve.alias
      .set('@', path.resolve(__dirname, './src/components'))
      .set('assets', path.resolve(__dirname, './src/assets'))
      .set('views', path.resolve(__dirname, './src/views'))
      .set('stores', path.resolve(__dirname, './src/store'))
  },

  devServer: {
    proxy: {
      '/app': {
        target: 'http://localhost:9000',
        changeOrigin: true
      },
      '/ajax': {
        target: 'https://api.10street.cn/api/',
        changeOrigin: true,
        pathRewrite:{
          '/ajax':''
        }
      },
      '/userlike': {
        target: 'https://api.10street.cn/api/goods/guess/like',
        changeOrigin: true,
        pathRewrite : {
          "/userlike": ""
        }
      },
      '/special': {
        target: 'https://api.10street.cn/api',
        changeOrigin: true,
        pathRewrite:{'/special':""}
      },
    }
  }
}